package com.strongdigit.spweb;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/hello")
public class HelloController {

   @Autowired
    private  GirlProperties girl;

   // @RequestMapping(value = "/hello",method = RequestMethod.GET)
    @RequestMapping(value = {"/say","/hi"},method = {RequestMethod.GET,RequestMethod.POST})
    public  String hello(){

        return "hello spring boot"+ girl.toString();
    }

    //@RequestMapping(value = "/param",method = RequestMethod.GET)
    @GetMapping("/param")
    public String param(@RequestParam(value = "id",required = false,defaultValue = "0") Integer myid){

        return myid.toString();
    }

}
